#include<iostream>
#include<vector>
#include<queue>
#include<cstring>
#include<cmath>
#include<map>
#include<set>
#include<cstdio>
#include<algorithm>
#define debug(a) cout<<#a<<"="<<a<<endl;
using namespace std;
const int maxn=1e5+1000;
typedef long long LL;
const LL mod=1e9+7;
inline LL read(){LL x=0,f=1;char ch=getchar();	while (!isdigit(ch)){if (ch=='-') f=-1;ch=getchar();}while (isdigit(ch)){x=x*10+ch-48;ch=getchar();}
return x*f;}
LL dp[maxn];
LL row[maxn];
/// 2 4 6 10 16
/// 4 6 8 12 18
/// 6 8 10 14 20
///10 12 14 18 24
///16 18 20 24 30
int main(void)
{
  cin.tie(0);std::ios::sync_with_stdio(false);
  LL n,m;cin>>n>>m;
  row[1]=2;row[2]=4;row[3]=6;
  for(LL i=4;i<maxn;i++) row[i]=(row[i-1]%mod+row[i-2]%mod)%mod;
  dp[1]=2;dp[2]=2;dp[3]=4;
  for(LL i=4;i<maxn;i++) dp[i]=(dp[i-1]%mod+dp[i-2]%mod)%mod;
  LL ans=row[n];
  for(LL i=2;i<=m;i++){
    ans=(ans%mod+dp[i-1]%mod)%mod;
  }
  cout<<ans%mod<<"\n";
return 0;
}
